<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../common/top_css.jsp"%>
<script src="${pageContext.request.contextPath}/bootstrap/js/jquery.js"></script> <!-- jQuery -->
<script type="text/javascript">
	$(function(){

		
		var total=0;
		$(".priceId").each(function(m){
			 total+=parseFloat($(this).text());
		});
		$("#totalpriceId").text(total);
		
	});
</script>

</head>

<body>
	<div class="navbar navbar-fixed-top bs-docs-nav" role="banner">
		<div class="conjtainer">
  			<%@ include file="../common/top_nav.jsp" %>
		</div>
	</div>

	<%@ include file="../common/top.jsp" %>
	<div class="content">
		<%@ include file="../common/left.jsp" %>
		<div class="mainbar">
		<%@ include file="../common/page-head.jsp" %>
			<div class="matter">
				<div class="container">
				<!-- 内容开始 -->
					<!-- 表单 -->
					<div class="widget wgreen">
		                <div class="widget-head">
		                  <div class="pull-left">订单明细</div>
		                  <div class="widget-icons pull-right">
		                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
		                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
		                  </div>
		                  <div class="clearfix"></div>
		                </div>
		                <div class="widget-content">
		                  <div class="padd">
		                    <!-- Form starts.  -->
		                     <form class="form-horizontal" role="form"> 
                                <div class="form-group">
                                  <label class="col-lg-1 control-label">企业名称：</label>
                                  <div class="col-lg-2">
                                  	<span>${order.supplier.name }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">订单类型：</label>
                                  <div class="col-lg-2">
									<span>${order.orderTypeView }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">提货方式：</label>
                                  <div class="col-lg-2">
                                  	<span>${order.supplier.needsView }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">订&nbsp;&nbsp;单&nbsp;&nbsp;号：</label>
                                  <div class="col-lg-2">
									<span>${order.ordernum }</span>
                                  </div>
                                </div> <div class="form-group">
                                  <label class="col-lg-1 control-label">联&nbsp;&nbsp;系&nbsp;&nbsp;人：</label>
                                  <div class="col-lg-2">
                                  	<span>${order.supplier.contact }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">联系方式：</label>
                                  <div class="col-lg-2">
									<span>${order.supplier.tele }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">商品总量：</label>
                                  <div class="col-lg-2">
                                  	<span>${order.totalnum }</span>
                                  </div>
                                  <label class="col-lg-1 control-label">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：</label>
                                  <div class="col-lg-2">
									<span>${order.supplier.address }元</span>
                                  </div>
                                </div>   
                                <hr>
                                <div class="form-group">
                                  <div class="col-lg-offset-1 col-lg-9">
                                  	<c:if test="${order.type==199}">
                                  	     <button type="button" class="btn btn-default" onclick="javascript:location.href='${pageContext.request.contextPath}/jsp/task/selecttask.jsp'">已结单</button>
                                  	</c:if>
                                  	<c:if test="${order.type!=199}">
                                    	<button type="button" class="btn btn-default" onclick="javascript:location.href='${pageContext.request.contextPath}/order/updateOrderDeteilByType2.action?uuid=${order.uuid}&type=199'">结单</button>
                                  	</c:if>
                                  </div>
                                </div>
                              </form>
		                  </div>
		                </div>
		                  <div class="widget-foot">
		                    <!-- Footer goes here -->
		                  </div>
		              </div>	
					<!-- 表格 -->
					<div class="widget">
		                <div class="widget-head">
		                  <div class="pull-left">订单明细</div>
		                  <div class="widget-icons pull-right">
		                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
		                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
		                  </div>  
		                  <div class="clearfix"></div>
		                </div>
		                <div class="widget-content">
			                <table class="table table-striped table-bordered table-hover" id="tables">
			                      <thead>
			                        <tr>
			                          <th>商品类别</th>
			                          <th>商品名称</th>
			                          <th>购买数量</th>
			                          <th>进货单价</th>
			                          <th>合计</th>
			                        </tr>
			                      </thead>
			                      <tbody id="tdAdd">
			                      	<c:forEach items="${order.orderDetailList}" var="o">
			                      		<tr>
			                      			<td>${o.goods.goodsType.name}</td>
			                      			<td>${o.goods.name}</td>
			                      			<td>${o.num}</td>
			                      			<td>${o.priceView}元</td>
			                      			<td><span  class="priceId">${o.totalprice}</span>元</td>
			                      		</tr>
			                      	</c:forEach>
			                      	<tr >
			                      		<td colspan="4"></td>
			                      		<td>总计：<span id="totalpriceId"></span>元</td>
			                      	</tr>
			                      </tbody>
			                    </table>

		                    <div class="widget-foot">
		                        <ul class="pagination pull-right">
		                          <li><a href="#">Prev</a></li>
		                          <li><a href="#">1</a></li>
		                          <li><a href="#">2</a></li>
		                          <li><a href="#">3</a></li>
		                          <li><a href="#">4</a></li>
		                          <li><a href="#">Next</a></li>
		                        </ul>
		                      <div class="clearfix"></div> 
		                    </div>
		
		                </div>
		
	                </div>
				
				
				<!-- 内容结束 -->
				</div>
			</div>
		</div>
	</div>
	<%@ include file="../common/footer.jsp" %>
 	<%@ include file="../common/footer_js.jsp" %>
</body>
</html>
